package com.dmgis.hndz.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dmgis.hndz.pojo.Qxaa01a;
import com.dmgis.hndz.service.Qxaa01aService;
import com.dmgis.hndz.mapper.Qxaa01aMapper;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
* @author Administrator
* @description 针对表【qxaa01a(小时将水表)】的数据库操作Service实现
* @createDate 2024-04-08 13:35:44
*/
@Service
public class Qxaa01aServiceImpl extends ServiceImpl<Qxaa01aMapper, Qxaa01a>
    implements Qxaa01aService{

    @Override
    public Map<String,Object> queryTrue(JSONObject jsonObject) {
        String id=jsonObject.getString("id");
        String startTime=jsonObject.getString("startTime");
        String endTime=jsonObject.getString("endTime");
        String grade=jsonObject.getString("grade");
        Integer currentPage=jsonObject.getInteger("currentPage");
        Integer pageSize=jsonObject.getInteger("pageSize");
        currentPage=(currentPage-1)*pageSize;
        List<Qxaa01a> list=baseMapper.getTrue(id,startTime,endTime,grade,currentPage,pageSize);
        Integer num=baseMapper.countTrue(id,startTime,endTime,grade);
        Map<String,Object> map=new HashMap<>();
        map.put("list",list);
        map.put("num",num);
        return map;
    }
}




